package com.coffee.admin.service.merchant.dao;

import com.coffee.admin.api.merchant.query.MerchantCityQuery;
import com.coffee.admin.service.merchant.bean.MerchantCity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MerchantCityDao {
    public MerchantCity findById(Integer id);

    public List<MerchantCity> findByMerchantId(Integer merchantId);

    public MerchantCity findByIdForUpdate(Integer id);

    public List<MerchantCity> findByIds(@Param("idList") List<Integer> idList);

    public Integer count(@Param("param") MerchantCityQuery param);

    public List<MerchantCity> page(@Param("param") MerchantCityQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public MerchantCity findFirst(@Param("param") MerchantCityQuery param);

    public Integer insert(MerchantCity param);

    Integer insertBatch(List<MerchantCity> list);

    public Integer updateById(@Param("param") MerchantCity param);

    public Integer updateIsDefaultToN(@Param("merchantId") Integer merchantId);

    public Integer updateIsDefaultToY(@Param("id") Integer id, @Param("merchantId") Integer merchantId);

    public Integer deleteById(@Param("id") Integer id, @Param("merchantId") Integer merchantId, @Param("type") String type);

    public Integer deleteByIds(List<Integer> idList);

}